package com.aerospace.algorithm;

import java.io.InputStream;

/**
 * @Author: Aerospace
 * @Date: 2021/5/5 13:28
 * @Description: Dream begins
 */

public class CountLastWordSize {
    public static void main(String[] args) throws Exception{
            int count = 0;
            InputStream in = System.in;
            char c = (char) in.read();
            while(c!='\n'){
                if(c==' '){
                    count = 0;
                }else{
                    count++;
                }
                c = (char) in.read();
            }
            System.out.print(count);
        }
}
